import { requestHasToken } from '@/utils/request'

/**
 * 获取作者列表
 */
export function getAuthorList(params) {
  return requestHasToken({
    method: 'get',
    url: `/author/list`,
    params
  })
}

/**
 * 获取作者详情
 */
export function getAuthorDetail(params) {
  return requestHasToken({
    method: 'get',
    url: `/author/detail`,
    params
  })
}

/**
 * 更新作者详情
 */
export function getAuthorUpdate(data) {
  return requestHasToken({
    method: 'post',
    url: `/author/update`,
    data
  })
}

/**
 * 获取作者所有作品
 */
export function getAuthorWorks(params) {
  return requestHasToken({
    method: 'get',
    url: `/works/list`,
    params
  })
}

/**
 * 删除作者作品
 */
export function getAuthorDelWorks(params) {
  return requestHasToken({
    method: 'delete',
    url: `/works/delete`,
    params
  })
}

/**
 * 添加作者作品
 */
export function getAuthorCreateWorks(data) {
  console.log(data)
  return requestHasToken({
    method: 'post',
    url: `/works/create`,
    data
  })
}
